<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <title>扩展模块-主页面</title>
<#include "plugin.ftl">
    <script type="text/javascript" src="/scripts/libs/json/jquery.jsonview.js"></script>
<#include "menu/plus-nav-menu.ftl" />
<#include "cache/cc-cache-ops.ftl" />
    <style>
        body {
            overflow: auto;
        }
    </style>
</head>
<body>
<div id="app" v-cloak style="width: 80%;margin: 0 auto">

    <plus-nav-menu></plus-nav-menu>
    <div style="margin-bottom: 5px;float: right">
        <el-button type="primary" @click="testLogin()">测试登录ape-ops-admin</el-button>
    </div>
    <cc-cache-ops></cc-cache-ops>
</div>
<script>
    new Vue({
        el: '#app',
        data: function () {
            return {
                //定义 存放url地址对象
                urls: {
                    testLoginUrl: '/v1/userlogin.html' //admin后台登录接口
                }
            }
        },
        methods: {
            testLogin() {
                var user = 'yuanjunnan';
                var pass = 'yuanjunnan@yjn@';
                var requestOptions = {
                    url: this.urls.testLoginUrl,
                    data: {
                        username: user,
                        password: pass
                    }
                }
                this.ccAjax(requestOptions).done(function (data) {
                    if (data.code == 0) {
                        this.$message('登录成功！')
                    }else {
                        this.$message({
                            type: 'error',
                            message: data.msg
                        })
                    }
                }.bind(this));
            }
        }
    });
</script>
</body>
</html>